#ifndef _HEADER_VECTORFIELD2_
#define _HEADER_VECTORFIELD2_
/**
 *This class defines a 2D Vector Field.
 *The Vector field data is stored in a 1D array of type Ogre::Vector2.
 *One access the vector field data as a NxN array.
 **/
#include <memory>
using namespace std;
#include "Ogre.h"
#include "FlowSimUtil.h"
namespace FlowSim
{
class VectorField2
{
public: //static methods
  static auto_ptr<VectorField2> testField(int size); //construct a 2d vector field for testing.
  static auto_ptr<VectorField2> blankField(int size); //construct a blank vector field for testing.
  static void testGpuField(const Ogre::TexturePtr &tex,int size); //construct a vector field and put it in a Texture object.
  static void blankGpuField(const Ogre::TexturePtr &tex, int size);
  static void testGpuField8(const Ogre::TexturePtr &tex, int size);
public:
  VectorField2(int size);
  virtual ~VectorField2();
  
  Ogre::Vector2* getData(); //returns the vector field data.
  void setVec(int x, int y,Ogre::Real vx, Ogre::Real vy); //set the vector at position x,y
  
  int getSize(){return _size;}

protected:

  int _size;
  Ogre::Vector2* _data;
};
}

#endif
